package Day2025_04_12;

import java.util.Scanner;

public class Demo04 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int T = in.nextInt();
        while (T-- != 0) {
            int n = in.nextInt();
            int[] arr = new int[n];
            int sum = 0;
            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
                sum ^= arr[i];
            }
            if (sum == 0) System.out.println("YES");
            else System.out.println("NO");
        }
    }
}
